package Controls
{
	import Objects.GameBitmap;
	import Objects.GameSprite;
	import Objects.GameTextField;
	
	import flash.events.Event;
	import flash.events.FocusEvent;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFieldType;

	public class InputBase extends GameSprite
	{
		public var back:GameBitmap;
		public var field:GameTextField;
		public function InputBase()
		{
			super();
			back=new GameBitmap();
			addChild(back);
			
			field=new GameTextField();
			field.textField.type = TextFieldType.INPUT;
			field.textField.autoSize = TextFieldAutoSize.NONE
			field.textField.selectable=true;
			addChild(field);
			
		}
		public function setup(width:Number,height:Number,border:int=1):void
		{
			back.scale(width,height);
			field.textField.width=width-border*2;
			field.textField.height=height-border*2;
			field.textField.x=border;
			field.textField.y=border;
			field.textField.defaultTextFormat=field.format;
		}
	}
}